import * as HWMeeting from 'hwmeeting'
import { useEffect } from 'react'
import style from './index.module.less'
import { getSearch } from '@src/assets/js/tool'
import { useLocation } from 'react-router-dom'
function Main () {
  const l = useLocation()
  useEffect(() => {
    const s = getSearch()
    if (s.c && s.p && s.n) {
      HWMeeting.joinConf({ confId: s.c, pwd: s.p, nickName: s.n })
      .then(() => {
        console.log('success')
      })
      .catch((e) => {
        console.error(e)
      })
    }
  }, [l])
  return (
    <div>
      <div id='root' className={style.container}></div>
      <div id='stream-pools' className={style['stream-pools']}></div>
    </div>
  )
}

export default Main
